pub struct ParsedPayload<T> {
    inner: T,
}

pub struct ParseError<E> {
    inner: E,
}

pub fn parse_payload<T, E>(stream: &[u8]) -> Result<ParsedPayload<T>, ParseError<E>> {
    todo!()
}

// 添加一个类型别名后，方法签名可以简化很多
type ParserResult<T, E> = Result<ParsedPayload<T>, ParseError<E>>;
pub fn parse_payload2<T, E>(stream: &[u8]) -> ParserResult<T, E> {
    todo!()
}

// 其他类型别名示例
type MyString = String;
type SomethingComplex<T, E> = Vec<Result<Option<T>, E>>;

struct SuperComplexParser<'s> {
    stream: &'s [u8],
}
type Parser<'s> = SuperComplexParser<'s>;

fn main() {
    todo!()
}